home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tc_tut.arc / SOURCE.ARC / COMPILER.DOC < prev    next >
Text File  |  1990-01-28  |  11KB  |  239 lines

  1. Coronado Enterprises Turbo C TUTOR (ver 1.50)      Feb 1, 1988
  2.  
  3. COMPILER.DOC file
  4.  
  5. This tutorial is written specifically for the Turbo-C compiler
  6. by Borland International.  It is written for the first release
  7. of that particular compiler, and many of the topics discussed
  8. refer to the User's Guide and Reference Guide for that particular
  9. release.  For that reason, when Borland releases a new version,
  10. some of the page numbers may be in error for the new release, but
  11. the topics will still be useable and valid.  It is written to
  12. teach you how to read and write Turbo C programs but even more
  13. important, it is intended to teach you the vocabulary of the C
  14. language so that you can intelligently read the literature about C.
  15.  
  16. Due to the ease of use of the Integrated Environment version of
  17. Turbo C, It will be used exclusively by this tutorial.  You can
  18. use the Command Line version of Turbo C with this tutorial, but
  19. all notes in the tutorial will describe use of the Integrated
  20. Environment version.
  21.  
  22.  
  23.  
  24. ******** Note - Note - Note - Note - Note - Note - Note *********
  25.  
  26. All of the files in the Coronado Enterprises Turbo C tutorial are
  27. designed to work with the Turbo C compiler with all options left
  28. in the default mode (ie - the way the compiler comes from the
  29. factory), and any changes may affect the way some of the example
  30. programs work.  For example, if you were to change the number of
  31. significant characters used for an identifier to 4, the program
  32. named SCOPE.C in chapter 5, would have all 3 functions named the
  33. same, namely "head", and the program would not work.  You would
  34. actually have other problems with this change, but they will not
  35. be commented on here.  Other kinds of errors are also possible, so
  36. it would be best that you simply use the Borland defaults for the
  37. duration of the tutorial and when you have gained experience with
  38. C, customize your compiler to suit your own taste.
  39.  
  40.  
  41.  
  42.  
  43. ****************** Suggested Hard Disk Setup *********************
  44. The Turbo C User's Guide has complete instructions describing
  45. how to set up your system for proper use.  Following the direc-
  46. tions given will result in the following directory setup if you
  47. are using a hard disk.  Some of the files have been omitted in
  48. this suggested setup to reduce the clutter in the TURBOC directory.
  49. This will reduce the confusion over extra files as you work your
  50. way through the tutorials.
  51.  
  52. Note that there are slight differences in using version 1.0 and
  53. 1.5 of TURBO C.  The differences will be pointed out in the follow-
  54. ing descriptions of setup and use.
  55.  
  56.       ********* TURBO C version 1.0 **********
  57.    TURBO C disk 1 - Integrated Development Env.
  58.    TURBO C disk 2 - Command Line/Utilities
  59.    TURBO C disk 3 - Header Files/Libraries/Examples
  60.    TURBO C disk 4 - Libraries/Examples
  61.  
  62.       ********* TURBO C version 1.5 **********
  63.    TURBO C disk 1 - Integrated Development Env.
  64.    TURBO C disk 2 - Command Line/Utilities
  65.    TURBO C disk 3 - Header Files/Libraries
  66.    TURBO C disk 4 - Libraries
  67.    TURBO C disk 5 - Examples
  68.  
  69.  
  70. C:\TURBOC\
  71.     TC.EXE                  /* From Turbo C disk 1              */
  72.     TCCONFIG.TC             /* You make this file - See below   */
  73.     TCHELP.TCH              /* From Turbo C disk 1 (ver 1.0)    */
  74.     TCHELP.TCH              /* From Turbo C disk 5 (ver 1.5)    */
  75.     *.*                     /* From Turbo C Tutor SOURCE disk   */
  76.  
  77. C:\TURBOC\INCLUDE\
  78.     *.H                     /* From Turbo C disk 3              */
  79.  
  80. C:\TURBOC\INCLUDE\SYS\
  81.     STAT.H                  /* From Turbo C disk 3 \SYS\ subdir.*/
  82.  
  83. C:\TURBOC\LIB\
  84.     *.OBJ                   /* From Turbo C disk 3              */
  85.     *.LIB                   /* From Turbo C disk 3              */
  86.     *.OBJ                   /* From Turbo C disk 4 - optional   */
  87.     *.LIB                   /* From Turbo C disk 4 - optional   */
  88.  
  89. The *.OBJ and *.LIB files from disk 4 are needed only if you wish
  90. to use additional memory models.  You only need the "Small" memory
  91. model to run all of the programs included in the Coronado Enter-
  92. prises Turbo C tutorial.
  93.  
  94. After creating the subdirectories listed above and loading them
  95. with the files listed, change to the TURBOC directory and create
  96. the TCCONFIG.TC file by following these instructions (note that
  97. the instructions are given on page 16 of the Turbo C User's guide
  98. but they are somewhat cryptic for the beginner).
  99.  
  100. 1.   TC<return>                  This loads the TURBO-C compiler
  101. 2.   O                           Selects "Options"
  102. 3.   E   (version 1.0)           Selects "Environment"
  103. 3.   D   (version 1.5)           Selects "Directories"
  104. 4.   I                           Selects "Include directories"
  105. 5.   \TURBOC\INCLUDE<return>     Sets directory for include files
  106. 6.   L                           Selects "Library directory"
  107. 7.   \TURBOC\LIB<return>         Sets directory for library files
  108. 8.   <Esc>                       Returns to "Options" menu
  109. 9.   S                           Selects "Store options"
  110. 10.  <return>                    Stores file named "TCCONFIG.TC"
  111. 11.  <Esc>                       Return to the TURBO-C main menu
  112.  
  113.  
  114.  
  115.  
  116. To run your first program.  (This assumes FIRSTEX.C has been copied
  117. into the \TURBOC\ directory from the tutorial SOURCE disk.)
  118.  
  119. 1.   TC<return>                  Loads the Turbo C compiler
  120. 2.   F                           Selects "Files"
  121. 3.   L                           Selects "Load"
  122. 4.   <return>                    Lists all files *.C
  123. 5.   Position cursor on FIRSTEX.C
  124. 6.   <return>                    Loads FIRSTEX.C
  125. 7.   Alt-R                       Compiles and runs FIRSTEX
  126.  
  127.  
  128.  
  129.  
  130.  
  131. **************** Suggested Dual Floppy Disk Setup *****************
  132.  
  133. The Turbo C User's Guide has very sketchy information on how to set
  134. up the system for use from two floppies so the following information
  135. is given to get you started.  As you gain experience with the C lan-
  136. guage, you can add features and move files around to make it more
  137. convenient to use.  The setup given here will result in the source
  138. files and executable files residing on drive B.  You will develop a
  139. more convenient system soon, but this setup will get you started.
  140. You will find that you will have to stop often and erase the *.OBJ
  141. and the *.EXE files that are generated by Turbo C or your disk will
  142. fill up with these extra files.
  143.  
  144. Format a disk with the system on it (ie - FORMAT A:/S) and put the
  145. following files on it for your drive A disk.
  146.  
  147.     TC.EXE                  /* From Turbo C disk 1              */
  148.     TCCONFIG.TC             /* You make this file - see below   */
  149.     TCHELP.TCH              /* From Turbo C disk 1 (ver 1.0)    */
  150.     TCHELP.TCH              /* From Turbo C disk 5 (ver 1.5)    */
  151.                             /* Note - You will probably have    */
  152.                             /* room for an AUTOEXEC.BAT file on */
  153.                             /* this disk also.                  */
  154.  
  155.  
  156. Format a disk without the system, make the following directories
  157. on it, and add the following files to it in their respective dir-
  158. ectories. This will be the disk for drive B.  You will put a few
  159. of the source files from the Coronado Enterprises tutorial on this
  160. disk in the root directory.
  161.  
  162. \
  163.     *.C                     /* From the Turbo C Tutor SOURCE disk */
  164.  
  165. \INCLUDE\
  166.     *.H                     /* From Turbo C disk 3                */
  167.  
  168. \INCLUDE\SYS\
  169.     STAT.H                  /* From Turbo C disk 3                */
  170.  
  171. \LIB\
  172.     COS.OBJ                 /* From Turbo C disk 3                */
  173.     CS.LIB                  /* From Turbo C disk 3                */
  174.     EMU.LIB                 /* From Turbo C disk 3                */
  175.     FP87.LIB                /* From Turbo C disk 3                */
  176.     MATHS.LIB               /* From Turbo C disk 3                */
  177.  
  178.  
  179. After creating the disks as listed above, install the disks in
  180. drive A and drive B and boot up the computer on drive A.  You
  181. must then create the TCCONFIG.TC file by following these instruc-
  182. tions (note that the instructions are given on page 14 of the Turbo
  183. C User's guide but they are somewhat cryptic for the beginner).
  184.  
  185.  
  186. 1.   TC<return>                  This loads the TURBO-C compiler
  187. 2.   O                           Selects "Options"
  188. 3.   E  (version 1.0)            Selects "Environment"
  189. 3.   D  (version 1.5)            Selects "Directories"
  190. 4.   I                           Selects "Include directories"
  191. 5.   B:\INCLUDE<return>          Sets directory for include files
  192. 6.   O                           Selects "Output directory"
  193. 7.   B:\<return>                 Sets directory for output files
  194. 8.   L                           Selects "Library directory"
  195. 9.   B:\LIB<return>              Sets directory for library files
  196. 10.  <Esc>                       Returns to "Options" menu
  197. 11.  S                           Selects "Store options"
  198. 12.  <return>                    Stores file named "TCCONFIG.TC"
  199. 13.  <Esc>                       Return to the TURBO-C main menu
  200. 14.  F                           Selects the "File" menu
  201. 15.  L                           Selects the "Load" submenu
  202. 16.  B:*.C<return>               Selects the B drive for files
  203. 17.  <Esc>                       Return to the "File" menu
  204. 18.  <Esc>                       Return to the TURBO-C main menu
  205.  
  206. Note that steps 14 through 16 must be performed once each time the
  207. Turbo C system is started to tell the system where to find the
  208. working files.
  209.  
  210. To run your first program.  (This assumes FIRSTEX.C has been copied
  211. into the root directory from the tutorial SOURCE disk.)  Load the
  212. two disks into the computer and boot up the system.
  213.  
  214. 1.   TC<return>                  Loads the Turbo C compiler
  215. 2.   F                           Selects "Files"
  216. 3.   L                           Selects "Load"
  217. 4.   B:*.C<return>               Lists all files *.C
  218. 5.   Position cursor on FIRSTEX.C
  219. 6.   <return>                    Loads FIRSTEX.C
  220. 7.   Alt-R                       Compiles and runs FIRSTEX
  221.  
  222.  
  223.  
  224.  
  225. **************** Suggested Single Floppy Disk Setup ****************
  226.  
  227. In order to use the Turbo C compiler with a single floppy disk,
  228. set up two disks as noted for the Dual Floppy Disk system.  Use the
  229. disk designated for drive A above to boot up the computer and perform
  230. steps 1 through 13 given above, leaving off the drive designation for
  231. drive B in steps 5, 7, 9, and 16.
  232.  
  233. To run the system, use the disk designated for drive A for booting
  234. and loading the TC system, then install the other disk as the work-
  235. ing disk.  You will have all of the capabilities of the dual drive
  236. system except for the "HELP" facility and the ability to run an oper-
  237. ating system shell from within the Turbo C Integrated environment.
  238.  
  239.